package fhp.hlhj.giantfold.activity.user

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import fhp.hlhj.giantfold.BaseActivity
import fhp.hlhj.giantfold.Contents
import fhp.hlhj.giantfold.R
import fhp.hlhj.giantfold.activity.GainDetailAty
import fhp.hlhj.giantfold.utils.MyUtils
import kotlinx.android.synthetic.main.activity_my_gain_aty.*

class MyGainAty : BaseActivity() {
    override fun getContentId(): Int = R.layout.activity_my_gain_aty

    override fun initListener() {
        btExit.setOnClickListener {
            finish()
        }
        btDetail.setOnClickListener {
            startActivity(Intent(this, GainDetailAty::class.java))

        }
    }
    override fun initView() {
        val info = Contents.userInfo
        totalGain.text=MyUtils.formatDouble(info?.earnings_accumulated!!.toDouble(),3)
        tvTodayGain.text=MyUtils.formatDouble(info?.earnings_today?.toDouble()!!,3)
        tvAvailable.text=MyUtils.formatDouble(info?.balance?.toDouble()!!,3)
        tvTotal.text=MyUtils.formatDouble(info?.principal.toDouble()!!,3)
    }
}
